//
//  CZPingLunTopView.swift
//  GZWeibo666
//
//  Created by mac－gt on 15/12/1.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit
//  协议
protocol CZPingLunTopViewDelegate: NSObjectProtocol{
    func PingLunTopViewClick()
}
class CZPingLunTopView: UIView {
    
    weak var delegate:CZPingLunTopViewDelegate?
    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor=UIColor.grayColor()
        setUp()
    }
     
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
   func setUp(){
       self.addSubview(pingLunButton)
    pingLunButton.ff_AlignInner(type: ff_AlignType.TopLeft, referView: self, size: CGSize(width: 50, height: 30), offset: CGPoint(x: 8, y: 0))
    }
    private lazy var pingLunButton:UIButton={
        let btn=UIButton()
        btn.setTitle("评论", forState: UIControlState.Normal)
        btn.titleLabel?.font=UIFont.systemFontOfSize(12)
        btn.setTitleColor(UIColor.orangeColor(), forState: UIControlState.Normal)
        btn.addTarget(self, action: "pingLunClick", forControlEvents: UIControlEvents.TouchUpInside)
        return btn
    }()
    //  让代理实现代理方法
    func pingLunClick(){
        self.delegate?.PingLunTopViewClick()
    }
}
